<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header"><?php echo __('All Product')?></h1>
        </div>
        <p>
            <a href="<?php echo $this->Html->url('/product/addproducttype') ?>" class="btn btn-primary" ><?php echo __('Create Product') ?></a>
        </p>
        <div class="col-lg-12">
            <div class="row">
               
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            Striped Rows
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th><?php echo __('Product Name') ?></th>
                                            <th><?php echo __('Product Type') ?></th>
                                            <th><?php echo __('Product parent') ?></th>
                                            <th class="width_100"><?php echo __('Create date') ?></th>
                                            <th class="width_100"> <?php echo __('Option') ?></th>
                                        </tr>
                                        <?php foreach($AllProducts as $product) :  ?>
                                        <tr>
                                            <td><?php echo $product['Product']['product_id'] ?></td>
                                            <td><?php echo $product['product_language'][0]['name'] ?></td>
                                            <td><?php echo key_exists($product['Product']['product_type'], $productType)?$productType[$product['Product']['product_type']]:"" ?></th>
                                            
                                            <td><?php echo $this->Custom->descriptionProduct($product['product_language'][0]['description'],200) ?></td>
                                            <td><?php echo $product['Product']['created'] ?></td>
                                            <td>
                                                <?php echo $this->Html->link(__('Edit'),
array('controller' => 'product', 'action' => 'addproduct', $product['Product']['product_type'],$product['Product']['product_id'])); ?>
                                                 | <?php echo $this->Html->link(__('Delete'),
array('controller' => 'product', 'action' => 'deleteproduct',$product['Product']['product_id'])); ?>
                                            </td>
                                        </tr>
                                        <?php endforeach; ?>
                                    </thead>
                                    <tbody>
                                        
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
            </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
</div>
<!-- /#page-wrapper -->